Next: Replacing text across multiple files, Previous: Forcing Emacs to iconify itself, Up: Common requests [Contents][Index]
See Regexp Backslash in The GNU Emacs Manual.
The or operator is ‘\|’,
not ‘|’, and the grouping operators are
‘\(’ and ‘\)’.
Also, the string syntax for a backslash is
‘\\’. To specify a regular expression
like ‘xxx\(foo\|bar\)’ in a Lisp string,
use ‘xxx\\(foo\\|bar\\)’.
Note the doubled backslashes!